import java.util.ArrayList;

/**
 * Created by WEN on 2016/10/9.
 */
public class RansomNote {
    public boolean canConstruct(String ransomNote, String magazine) {
        ArrayList<Character> list = new ArrayList<Character>();

        for(int i=0; i<magazine.length(); i++){
            list.add(magazine.charAt(i));
        }
        for(int i=0; i<ransomNote.length(); i++){
            if(list.remove((Character) ransomNote.charAt(i))==false)
                return false;
        }
        return true;
    }
}
